package com.lins.common.mp.config;

import org.modelmapper.ModelMapper;
import org.modelmapper.convention.MatchingStrategies;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * @author yuxiaolin
 * @title: CommonWebConfig
 * @projectName lins
 * @description: web 通用设置
 * @date 2021/12/13 12:43 下午
 */

@Configuration
public class CommonWebConfig {

    @Bean
    public ModelMapper modelMapper()
    {
        ModelMapper modelMapper = new ModelMapper();
        modelMapper.getConfiguration().setAmbiguityIgnored(true).setSkipNullEnabled(true)
            .setFullTypeMatchingRequired(true).setMatchingStrategy(MatchingStrategies.STRICT);
        return modelMapper;
    }

}
